﻿using AutoMapper;
using GetSlaughterItem.API.Application.Commands.Week02.ScaleData;
using SlaughterItem.API.Application.Commands.Week01.ManageCommands.Busines;
using SlaughterItem.API.Application.Commands.Week01.ManageCommands.Clientses;
using SlaughterItem.API.Application.Commands.Week01.SectionCommands;
using SlaughterItem.API.Application.Commands.Week01.UsersCommands;
using SlaughterItem.API.Application.Commands.Week02.Leo;
using SlaughterItem.Common.Domains.ListWeek2;
using SlaughterItem.API.Application.Commands.Week02.Setups;
using SlaughterItem.Common.Domains.Manages;
using SlaughterItem.Common.Domains.RBAC;
using SlaughterItem.Common.Domains.SetUpScale;
using SlaughterItem.Common.Domains.Setup;
using SlaughterItem.Common.Dtos;
using System;
using SlaughterItem.API.Application.Commands.Week03.leo;
using SlaughterItem.Common.Domains.Saleser;
using SlaughterItem.Common.Domains.Detection;
using SlaughterItem.API.Application.Commands.Week02._IPQC.AddIPQCData;
using SlaughterItem.API.Application.Commands.Week02._IPQC.AddIPQCData.IPQCRemarkData_;
using SlaughterItem.API.Application.Commands.Week02._PRQS.AddPRQSData;
using SlaughterItem.API.Application.Commands.Week02.POOK.AddWhitePork;
using SlaughterItem.Common.Domains.PORk;
using SlaughterItem.Common.Domains.RKWeigh;
using SlaughterItem.API.Application.Commands.Week02.RKWeighData_;
using SlaughterItem.API.Application.Commands.Week02.Log;
using SlaughterItem.Common.Domains.Log;
using SlaughterItem.API.Application.Commands.Week02._IPQC.AddIPQCData.AddIPQCGoods;
using SlaughterItem.API.Application.Commands.Week02.UPC;
using SlaughterItem.Common.Domains.UPCTable;
using SlaughterItem.API.Application.Commands.Week02.COA;
using SlaughterItem.API.Application.Commands.Week02.Killplan;
using SlaughterItem.API.Application.Commands.Week03.wenk;

namespace SlaughterItem.API.Commons
{
    public class AutoMapperProfile:Profile
    {
        //public AutoMapperProfile()
        //{
        //    //穿件用户新增的映射 ，由 新增用户的入参 转换为用户实体
        //    CreateMap<UsersAddCommand, Users>();
        //    //ReverseMap两个对象可以相互转换
        //    CreateMap<Users, UserDto>().ReverseMap();
        //    //两个对象，属性名称不相同
        //    CreateMap<People, Person>().ForMember(x => x.UserName, y => y.MapFrom(p => p.Name)).ForMember(x => x.UserAge, y => y.MapFrom(p => p.Age)).ReverseMap();


        //    //两个对象 谢谢 数据类型不相同 String==> int string==>Datetime
        //}

        /// <summary>
        /// 映射
        /// </summary>
        public AutoMapperProfile()
        {
            // 客户添加
            CreateMap<ClientsAddCommend, Clients>();
            //企业管理新增
            CreateMap<BusinesCreateCommand, Business>();
            //部门添加
            CreateMap<SectionAddCommend,Sections>();
            //磅秤表新增
            CreateMap<AddScaleDataCommand, scaleContexts>();
            //待宰管理
            CreateMap<SlaughteredCreaetCommend, Slaughteredtes>();
            //磅秤类型添加
            CreateMap<ScaleTypeCreateCommend, ScaleType>();
            //待宰圈设置新增
            CreateMap<WaitingCreateCommand,Waitings>();
            //扣减项设置新增
            CreateMap<DeductionsCreateCommand, Deductions>();
            //批宰计划新增
            CreateMap<SlaughterCreateCommand, Slaughter>();
            //检疫项目新增
            CreateMap<AddPRQSDataCommand, PRQSData>();
            //检测标准新增
            CreateMap<AddIPQCDataCommand, IPQCData>();
            //检测标准备注新增
            CreateMap<IPQCRemarkDataCommand,IPQCRemarkData>();
            //皮重
            CreateMap<TareCreateCommend, Tare>();
            //分割领用
            CreateMap<SplitRequisCreateCommend, SplitRequis>();
            //扣减项设置新增
            CreateMap<WeighingSheetsCreateCcommand, WeighingSheets > ();
            //销售称重
            CreateMap<SaleCreateCommend, Sale> ();
            //销售明细
            CreateMap<SaleDetaisCreateCommend, SalesDetails> ();
            //白条称重明细表新增
            CreateMap<AddWhitePorkCommand, WhiteporkData>();
            //日志管理新增
            CreateMap<AddLogDataCommand, LogData>();
            //分割称重入库新增
            CreateMap<AddRKWeighDataCommand, RKWeighData>();
            //检疫标准应用商品新增
            CreateMap<AddIPQCGoodsCommand, IPQCGoodsData>();
            //检疫标准应用商品新增
            CreateMap<AddUPCDataCommand, UPCData>();
            //膘油称重表
            CreateMap<OilyfatCreateCommend, Oilyfat>();
            //生产划膘单
            CreateMap<ScratchesCreateCommend, Scratches>();
        }

    }
}
